package com.rceeslca.common.page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页
 * @author rceeslca
 */
@Data
@ApiModel(value = "分页数据")
public class PageData<T> implements Serializable {

    private static final long serialVersionUID = 6654608196716148092L;

    @ApiModelProperty(value="总记录数")
    private int total;

    @ApiModelProperty(value="列表数据")
    private List<T> list;


    /**
     * 分页
     * @param list 数据
     * @param total 总数
     */
    public PageData(List<T> list,long total){
        this.list = list;
        this.total = (int)total;
    }

}
